3.11.96 \(\int x^2 (A+B x) (a+b x+c x^2)^p \, dx\) [1096]

3.11.96.1 Optimal result
3.11.96.2 Mathematica [C] (verified)
3.11.96.3 Rubi [A] (verified)
3.11.96.4 Maple [F]
3.11.96.5 Fricas [F]
3.11.96.6 Sympy [F]
3.11.96.7 Maxima [F]
3.11.96.8 Giac [F]
3.11.96.9 Mupad [F(-1)]

3.11.96.1 Optimal result

Integrand size = 21, antiderivative size = 287 \[ \int x^2 (A+B x) \left (a+b x+c x^2\right )^p \, dx=\frac {B x^2 \left (a+b x+c x^2\right )^{1+p}}{2 c (2+p)}-\frac {(2 a B c (3+2 p)+b (2+p) (2 A c (2+p)-b B (3+p))-2 c (1+p) (2 A c (2+p)-b B (3+p)) x) \left (a+b x+c x^2\right )^{1+p}}{4 c^3 (1+p) (2+p) (3+2 p)}-\frac {2^{-1+p} \left (6 a b B c-4 a A c^2+2 A b^2 c (2+p)-b^3 B (3+p)\right ) \left (-\frac {b-\sqrt {b^2-4 a c}+2 c x}{\sqrt {b^2-4 a c}}\right )^{-1-p} \left (a+b x+c x^2\right )^{1+p} \operatorname {Hypergeometric2F1}\left (-p,1+p,2+p,\frac {b+\sqrt {b^2-4 a c}+2 c x}{2 \sqrt {b^2-4 a c}}\right )}{c^3 \sqrt {b^2-4 a c} (1+p) (3+2 p)} \]

output
1/2*B*x^2*(c*x^2+b*x+a)^(p+1)/c/(2+p)-1/4*(2*a*B*c*(3+2*p)+b*(2+p)*(2*A*c* 
(2+p)-b*B*(3+p))-2*c*(p+1)*(2*A*c*(2+p)-b*B*(3+p))*x)*(c*x^2+b*x+a)^(p+1)/ 
c^3/(2+p)/(2*p^2+5*p+3)-2^(-1+p)*(6*B*a*b*c-4*A*a*c^2+2*A*b^2*c*(2+p)-b^3* 
B*(3+p))*(c*x^2+b*x+a)^(p+1)*hypergeom([-p, p+1],[2+p],1/2*(b+2*c*x+(-4*a* 
c+b^2)^(1/2))/(-4*a*c+b^2)^(1/2))*((-b-2*c*x+(-4*a*c+b^2)^(1/2))/(-4*a*c+b 
^2)^(1/2))^(-1-p)/c^3/(p+1)/(3+2*p)/(-4*a*c+b^2)^(1/2)
 
3.11.96.2 Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 6 vs. order 5 in optimal.

Time = 0.48 (sec) , antiderivative size = 210, normalized size of antiderivative = 0.73 \[ \int x^2 (A+B x) \left (a+b x+c x^2\right )^p \, dx=\frac {1}{12} x^3 \left (\frac {b-\sqrt {b^2-4 a c}+2 c x}{b-\sqrt {b^2-4 a c}}\right )^{-p} \left (\frac {b+\sqrt {b^2-4 a c}+2 c x}{b+\sqrt {b^2-4 a c}}\right )^{-p} (a+x (b+c x))^p \left (4 A \operatorname {AppellF1}\left (3,-p,-p,4,-\frac {2 c x}{b+\sqrt {b^2-4 a c}},\frac {2 c x}{-b+\sqrt {b^2-4 a c}}\right )+3 B x \operatorname {AppellF1}\left (4,-p,-p,5,-\frac {2 c x}{b+\sqrt {b^2-4 a c}},\frac {2 c x}{-b+\sqrt {b^2-4 a c}}\right )\right ) \]

input
Integrate[x^2*(A + B*x)*(a + b*x + c*x^2)^p,x]
 
output
(x^3*(a + x*(b + c*x))^p*(4*A*AppellF1[3, -p, -p, 4, (-2*c*x)/(b + Sqrt[b^ 
2 - 4*a*c]), (2*c*x)/(-b + Sqrt[b^2 - 4*a*c])] + 3*B*x*AppellF1[4, -p, -p, 
 5, (-2*c*x)/(b + Sqrt[b^2 - 4*a*c]), (2*c*x)/(-b + Sqrt[b^2 - 4*a*c])]))/ 
(12*((b - Sqrt[b^2 - 4*a*c] + 2*c*x)/(b - Sqrt[b^2 - 4*a*c]))^p*((b + Sqrt 
[b^2 - 4*a*c] + 2*c*x)/(b + Sqrt[b^2 - 4*a*c]))^p)
 
3.11.96.3 Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 295, normalized size of antiderivative = 1.03, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {1236, 25, 1225, 1096}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int x^2 (A+B x) \left (a+b x+c x^2\right )^p \, dx\)

\(\Big \downarrow \) 1236

\(\displaystyle \frac {\int -x (2 a B-(2 A c (p+2)-b B (p+3)) x) \left (c x^2+b x+a\right )^pdx}{2 c (p+2)}+\frac {B x^2 \left (a+b x+c x^2\right )^{p+1}}{2 c (p+2)}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {B x^2 \left (a+b x+c x^2\right )^{p+1}}{2 c (p+2)}-\frac {\int x (2 a B-(2 A c (p+2)-b B (p+3)) x) \left (c x^2+b x+a\right )^pdx}{2 c (p+2)}\)

\(\Big \downarrow \) 1225

\(\displaystyle \frac {B x^2 \left (a+b x+c x^2\right )^{p+1}}{2 c (p+2)}-\frac {\frac {\left (a+b x+c x^2\right )^{p+1} (2 a B c (2 p+3)-2 c (p+1) x (2 A c (p+2)-b B (p+3))+b (p+2) (2 A c (p+2)-b B (p+3)))}{2 c^2 (p+1) (2 p+3)}-\frac {(p+2) \left (-4 a A c^2+6 a b B c+2 A b^2 c (p+2)+b^3 (-B) (p+3)\right ) \int \left (c x^2+b x+a\right )^pdx}{2 c^2 (2 p+3)}}{2 c (p+2)}\)

\(\Big \downarrow \) 1096

\(\displaystyle \frac {B x^2 \left (a+b x+c x^2\right )^{p+1}}{2 c (p+2)}-\frac {\frac {2^p (p+2) \left (a+b x+c x^2\right )^{p+1} \left (-\frac {-\sqrt {b^2-4 a c}+b+2 c x}{\sqrt {b^2-4 a c}}\right )^{-p-1} \left (-4 a A c^2+6 a b B c+2 A b^2 c (p+2)+b^3 (-B) (p+3)\right ) \operatorname {Hypergeometric2F1}\left (-p,p+1,p+2,\frac {b+2 c x+\sqrt {b^2-4 a c}}{2 \sqrt {b^2-4 a c}}\right )}{c^2 (p+1) (2 p+3) \sqrt {b^2-4 a c}}+\frac {\left (a+b x+c x^2\right )^{p+1} (2 a B c (2 p+3)-2 c (p+1) x (2 A c (p+2)-b B (p+3))+b (p+2) (2 A c (p+2)-b B (p+3)))}{2 c^2 (p+1) (2 p+3)}}{2 c (p+2)}\)

input
Int[x^2*(A + B*x)*(a + b*x + c*x^2)^p,x]
 
output
(B*x^2*(a + b*x + c*x^2)^(1 + p))/(2*c*(2 + p)) - (((2*a*B*c*(3 + 2*p) + b 
*(2 + p)*(2*A*c*(2 + p) - b*B*(3 + p)) - 2*c*(1 + p)*(2*A*c*(2 + p) - b*B* 
(3 + p))*x)*(a + b*x + c*x^2)^(1 + p))/(2*c^2*(1 + p)*(3 + 2*p)) + (2^p*(2 
 + p)*(6*a*b*B*c - 4*a*A*c^2 + 2*A*b^2*c*(2 + p) - b^3*B*(3 + p))*(-((b - 
Sqrt[b^2 - 4*a*c] + 2*c*x)/Sqrt[b^2 - 4*a*c]))^(-1 - p)*(a + b*x + c*x^2)^ 
(1 + p)*Hypergeometric2F1[-p, 1 + p, 2 + p, (b + Sqrt[b^2 - 4*a*c] + 2*c*x 
)/(2*Sqrt[b^2 - 4*a*c])])/(c^2*Sqrt[b^2 - 4*a*c]*(1 + p)*(3 + 2*p)))/(2*c* 
(2 + p))
 

3.11.96.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 1096
Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Rt[b^2 
 - 4*a*c, 2]}, Simp[(-(a + b*x + c*x^2)^(p + 1)/(q*(p + 1)*((q - b - 2*c*x) 
/(2*q))^(p + 1)))*Hypergeometric2F1[-p, p + 1, p + 2, (b + q + 2*c*x)/(2*q) 
], x]] /; FreeQ[{a, b, c, p}, x] &&  !IntegerQ[4*p] &&  !IntegerQ[3*p]
 

rule 1225
Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*( 
x_)^2)^(p_), x_Symbol] :> Simp[(-(b*e*g*(p + 2) - c*(e*f + d*g)*(2*p + 3) - 
 2*c*e*g*(p + 1)*x))*((a + b*x + c*x^2)^(p + 1)/(2*c^2*(p + 1)*(2*p + 3))), 
 x] + Simp[(b^2*e*g*(p + 2) - 2*a*c*e*g + c*(2*c*d*f - b*(e*f + d*g))*(2*p 
+ 3))/(2*c^2*(2*p + 3))   Int[(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c 
, d, e, f, g, p}, x] &&  !LeQ[p, -1]
 

rule 1236
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c 
_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[g*(d + e*x)^m*((a + b*x + c*x^2)^(p + 
1)/(c*(m + 2*p + 2))), x] + Simp[1/(c*(m + 2*p + 2))   Int[(d + e*x)^(m - 1 
)*(a + b*x + c*x^2)^p*Simp[m*(c*d*f - a*e*g) + d*(2*c*f - b*g)*(p + 1) + (m 
*(c*e*f + c*d*g - b*e*g) + e*(p + 1)*(2*c*f - b*g))*x, x], x], x] /; FreeQ[ 
{a, b, c, d, e, f, g, p}, x] && GtQ[m, 0] && NeQ[m + 2*p + 2, 0] && (Intege 
rQ[m] || IntegerQ[p] || IntegersQ[2*m, 2*p]) &&  !(IGtQ[m, 0] && EqQ[f, 0])
 
3.11.96.4 Maple [F]

\[\int x^{2} \left (B x +A \right ) \left (c \,x^{2}+b x +a \right )^{p}d x\]

input
int(x^2*(B*x+A)*(c*x^2+b*x+a)^p,x)
 
output
int(x^2*(B*x+A)*(c*x^2+b*x+a)^p,x)
 
3.11.96.5 Fricas [F]

\[ \int x^2 (A+B x) \left (a+b x+c x^2\right )^p \, dx=\int { {\left (B x + A\right )} {\left (c x^{2} + b x + a\right )}^{p} x^{2} \,d x } \]

input
integrate(x^2*(B*x+A)*(c*x^2+b*x+a)^p,x, algorithm="fricas")
 
output
integral((B*x^3 + A*x^2)*(c*x^2 + b*x + a)^p, x)
 
3.11.96.6 Sympy [F]

\[ \int x^2 (A+B x) \left (a+b x+c x^2\right )^p \, dx=\int x^{2} \left (A + B x\right ) \left (a + b x + c x^{2}\right )^{p}\, dx \]

input
integrate(x**2*(B*x+A)*(c*x**2+b*x+a)**p,x)
 
output
Integral(x**2*(A + B*x)*(a + b*x + c*x**2)**p, x)
 
3.11.96.7 Maxima [F]

\[ \int x^2 (A+B x) \left (a+b x+c x^2\right )^p \, dx=\int { {\left (B x + A\right )} {\left (c x^{2} + b x + a\right )}^{p} x^{2} \,d x } \]

input
integrate(x^2*(B*x+A)*(c*x^2+b*x+a)^p,x, algorithm="maxima")
 
output
integrate((B*x + A)*(c*x^2 + b*x + a)^p*x^2, x)
 
3.11.96.8 Giac [F]

\[ \int x^2 (A+B x) \left (a+b x+c x^2\right )^p \, dx=\int { {\left (B x + A\right )} {\left (c x^{2} + b x + a\right )}^{p} x^{2} \,d x } \]

input
integrate(x^2*(B*x+A)*(c*x^2+b*x+a)^p,x, algorithm="giac")
 
output
integrate((B*x + A)*(c*x^2 + b*x + a)^p*x^2, x)
 
3.11.96.9 Mupad [F(-1)]

Timed out. \[ \int x^2 (A+B x) \left (a+b x+c x^2\right )^p \, dx=\int x^2\,\left (A+B\,x\right )\,{\left (c\,x^2+b\,x+a\right )}^p \,d x \]

input
int(x^2*(A + B*x)*(a + b*x + c*x^2)^p,x)
 
output
int(x^2*(A + B*x)*(a + b*x + c*x^2)^p, x)